package main.java.com.zjh.automation.main;

import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.TextEvent;
import java.util.Random;


public class RunThis {

    public static void main(String[] args) throws AWTException {

        // https://blog.csdn.net/jarvan5/article/details/105574427 Awt

        Robot r = new Robot();//创建自动化工具对象
        //切换应用
        r.keyPress(KeyEvent.VK_ALT);
        r.keyPress(KeyEvent.VK_TAB);
        r.keyRelease(KeyEvent.VK_ALT);
        r.keyRelease(KeyEvent.VK_TAB);
        //按下回车
        r.keyPress(KeyEvent.VK_ENTER);
        r.keyPress(KeyEvent.VK_ENTER);
        //粘贴剪贴板的内容
        r.keyPress(KeyEvent.VK_CONTROL);
//        r.delay(100);
        r.keyPress(KeyEvent.VK_V);
        r.keyRelease(KeyEvent.VK_CONTROL);
        r.keyRelease(KeyEvent.VK_V);
        //按下回车
        r.keyPress(KeyEvent.VK_ENTER);
        r.keyPress(KeyEvent.VK_ENTER);
    }

}
